﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Net.Mime.MediaTypeNames;

namespace MonoEarth.Entities
{
    public class QPoint : QGeometry
    {

      
        public QPoint(GameEarth game) : base(game)
        {

        }
        public Texture2D point;
        public override string Name { get; set; } = "点";

        public float X {  get; set; }
        public float Y { get; set; }
        public Color BColor { get; set; }=Color.White;


        public override void LoadContent()
        {
           
            point =_game.Content.Load<Texture2D>("images/point");
           
         
        }

        public override void Draw(GameTime gameTime)
        {


            _localProjection = Matrix.CreateOrthographicOffCenter(0f, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0f, 0f, 1f);
            _localView = Matrix.Identity;
            _primitiveBatch.Begin(ref _localProjection, ref _localView);

         

            _primitiveDrawing.DrawSolidCircle(new Vector2(X, Y),2, Color.Red);
           
            _primitiveDrawing.DrawSegment(new Vector2(20,30),new Vector2(X,Y),Color.Red);
           
            _primitiveBatch.End();


            _spriteBatch.Begin(transformMatrix: _localView);
             _spriteBatch.Draw(point, new Vector2(X-point.Width/2,Y-point.Height/2), BColor);
            _spriteBatch.End();
        }

        public override void Update(GameTime gameTime)
        {
            
        }
    }
}
